﻿using Ceremony.API.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Ceremony.API.Infrastructure.EntityConfigurations
{
    public class BobingPrizeEntityTypeConfiguration
        : IEntityTypeConfiguration<BobingPrize>
    {
        public void Configure(EntityTypeBuilder<BobingPrize> builder)
        {
            builder.ToTable("BobingPrize");

            builder.HasKey(ci => ci.Id);

            builder.Property(ci => ci.Id)
               .UseHiLo("bobingprize_hilo")
               .IsRequired();

            builder.Property(cb => cb.PrizeType)
                .IsRequired(true);
            builder.Property(cb => cb.PrizeName)
                .IsRequired(true)
                .HasMaxLength(100);
            builder.Property(cb => cb.Integral)
                .IsRequired(true);
            builder.Property(cb => cb.CreateTime)
               .IsRequired(true);
        }
    }
}
